<template>
  <basic-container :btnFlag=true>
    <div class="card-border">
      <card-header :header-data="headerData"></card-header>
      <el-steps :active="2" simple style="margin-top: 10px">
        <el-step title="基本信息入库" icon="el-icon-edit"></el-step>
        <el-step title="相关课题入库" icon="el-icon-upload"></el-step>
        <el-step title="相关报告入库" icon="el-icon-picture"></el-step>
      </el-steps>
      <div style="float: right;margin:19px 5px 9px 0px">
        <el-button type="success" size="mini" @click="addReportResult()">添加相关报告</el-button>
      </div>
      <avue-crud :data="reportResultListData"
                 :option="reportResultOption"
                 :page="reportResultPage"
                 :table-loading="tableLoading"
                 @on-load="getReportResultList"
                 @size-change="sizeChange"
                 @current-change="currentChange"
                 class="avuecrud">
        <template slot-scope="scope" slot="menu">
          <div class="menu-title" @click.stop="editReportResult(scope.row,scope.index)">
            <i class="iconfont iconalter icon-warning"></i>
            <p class="menu-title-text">修改</p>
          </div>
        </template>
      </avue-crud>

      <div style="float: right;margin:19px 5px 9px 0px">
        <el-button type="success" size="mini" @click="addAdjustResult()">添加调整建议</el-button>
      </div>
      <avue-crud :data="adjustResultListData"
                 :option="adjustResultOption"
                 :page="adjustResultPage"
                 :table-loading="adjustTableLoading"
                 @on-load="getAdjustResultList"
                 @size-change="adjustSizeChange"
                 @current-change="adjustCurrentChange"
                 class="avuecrud">
        <template slot-scope="scope" slot="menu">
          <div class="menu-title" @click.stop="editAdjustResult(scope.row,scope.index)">
            <i class="iconfont iconalter icon-warning"></i>
            <p class="menu-title-text">修改</p>
          </div>
        </template>
      </avue-crud>
      <div style="text-align: center;margin-top: 30px">
        <el-button type="primary" @click="beforeStep()">上一步</el-button>
        <el-button @click="goBack()">关 闭</el-button>
      </div>


      <!--添加相关报告-->
      <el-dialog :title="addReportResultTitle" :visible.sync="addReportResultVisible" @close='close' @closed='closed'
                 width="60%" :key="addReportResultKey">
        <el-form label-width="130px"
                 :model="addReportForm"
                 style="padding-right: 30px;"
                 :rules="addReportFormRules"
                 ref="addReportForm">
          <el-row>
            <el-col :span="10">
              <el-form-item class="form-item-release"
                            label="报告名称 :"
                            prop="reportType">
                <el-select v-model="addReportForm.reportType"
                           placeholder="请选择报告类型"
                           :key="2">
                  <el-option v-for="li in reportNameList"
                             :key="li.type"
                             :value="li.type"
                             :label="li.name"
                             :disabled="li.disable"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item class="form-item-release"
                            v-if="addReportForm.reportType==1"
                            label="年份:"
                            prop="year">
                <el-date-picker v-model="addReportForm.year"
                                value-format='yyyy'
                                type="year"
                                placeholder="选择年">
                </el-date-picker>

              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="22">
              <el-form-item class="form-item-release"
                            label="报告文件:"
                            prop="reportFilesId">
                <el-upload class="upload-demo"
                           ref="upload"
                           :limit="1"
                           :on-exceed="tipFileOne"
                           action="string"
                           :http-request="submitUploadtextMixin"
                           :on-preview="handlePreviewtextMixin"
                           :on-remove="handleRemovetextMixin"
                           :file-list="fileListtextMixin"
                           :auto-upload="true"
                           :on-change="fileChangetextMixin">
                  <el-button slot="trigger"
                             size="small"
                             type="primary">点击上传
                  </el-button>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="22">
              <el-form-item class="form-item-release"
                            label="相关材料:"
                            prop="content">
                <el-upload class="upload-demo"
                           ref="uploadrelated"
                           action="string"
                           :http-request="submitUploadMixin"
                           :on-preview="handlePreviewMixin"
                           :on-remove="handleRemoveMixin"
                           :file-list="fileListMixin"
                           :auto-upload="true"
                           :on-change="fileChangeMixin">
                  <el-button slot="trigger"
                             size="small"
                             type="primary">点击上传
                  </el-button>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="16">
              <el-form-item label="起草单位 :" prop="createUnit" class="form-item-release">
                <span style="font-size: 16px">{{addReportForm.createUnit}}</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-button size="small" type="primary" icon="el-icon-plus" style="margin-left: 10px;"
                         @click="clickMainDept">选择起草单位
              </el-button>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item class="form-item-release" label="起草时间 :" prop="draftTime">
                <el-date-picker
                  style="width: 100%"
                  v-model="addReportForm.draftTime"
                  type="date"
                  placeholder="选择起草时间"
                  value-format="yyyy-MM-dd"
                  format="yyyy-MM-dd"
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div style="text-align: center;">
          <span slot="footer"
                class="dialog-footer">
             <el-button type="primary"
                        :disabled="isDisabled"
                        @click="commitReportResult()"
                        v-if="addOrEdit">确 定</el-button>
            <el-button type="primary"
                       :disabled="isDisabled"
                       @click="commitReportResultEdit()"
                       v-if="!addOrEdit">确定修改</el-button>
            <el-button @click="cancel()">取 消</el-button>
          </span>
        </div>
      </el-dialog>

      <!--添加修订调整建议-->
      <el-dialog :title="addAdjustResultTitle" :visible.sync="addAdjustResultVisible" @close='adjustResultclose'
                 @closed='adjustResultclosed'
                 width="60%" :key="addAdjustResultKey">
        <el-form label-width="130px"
                 :model="addAdjustForm"
                 style="padding-right: 30px;"
                 :rules="addAdjustFormRules"
                 ref="addAdjustForm">
          <el-row>
            <el-col :span="22">
              <el-form-item class="form-item-release" label="2调整建议名称 :" prop="reviseName">
                <el-input v-model="addAdjustForm.reviseName" placeholder="请输入调整建议名称"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="22">
              <el-form-item class="form-item-release" label="调整内容 :" prop="content">
                <el-input
                  type="textarea"
                  :autosize="{ minRows: 4, maxRows: 4}"
                  placeholder="请输入调整内容"
                  v-model="addAdjustForm.content"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="22">
              <el-form-item class="form-item-release"
                            label="相关材料:"
                            prop="contentFileIds">
                <el-upload class="upload-demo"
                           ref="uploadrelatedResult"
                           action="string"
                           :http-request="submitUploadMixinResult"
                           :on-preview="handlePreviewMixinResult"
                           :on-remove="handleRemoveMixinResult"
                           :file-list="fileListMixinResult"
                           :auto-upload="true"
                           :on-change="fileChangeMixinResult">
                  <el-button slot="trigger"
                             size="small"
                             type="primary">点击上传
                  </el-button>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div style="text-align: center;">
          <span slot="footer"
                class="dialog-footer">
             <el-button type="primary"
                        :disabled="isDisabled"
                        @click="commitAdjustResult()"
                        v-if="addOrEditAdjust">确 定</el-button>
            <el-button type="primary"
                       :disabled="isDisabled"
                       @click="commitAdjustResultEdit()"
                       v-if="!addOrEditAdjust">确定修改</el-button>
            <el-button @click="cancelAdjust()">取 消</el-button>
          </span>
        </div>
      </el-dialog>
      <!--起草单位树-->
      <dept-select :visible="deptVisible" @getSelectInfo="getSelectInfo" @cancel="cancelDept"></dept-select>
    </div>
  </basic-container>
</template>

<script>
  import {resultDetail} from "@/api/planning/result";
  import {addReportFormRules, addAdjustFormRules} from "@/const/infoRules";
  import textfile from "@/mixins/textfile";
  import relatedfile from "@/mixins/relatedfile";
  import relatedfileResult from "@/mixins/relatedfileResult";

  import {
    addReportResult,
    getReportResultList,
    getReportDetail,
    modifyReport,
    getAdjustResultList,
    addAdjustResult,
    getReviseDetail,
    editReportOpinion,
    reportResultEdit
  } from "@/api/pim/pim";
  import {getFileTypeFiles} from '@/views/util'

  export default {
    name: "resultAddReport",
    mixins: [textfile, relatedfile,relatedfileResult],
    created() {
      this.setAchievement();
      this.putAdjustResultList();
    },
    data() {
      return {
        headerData: {
          title: '成果入库'
        },
        tableLoading: false,
        reportResultListData: [],
        reportResultPage: {
          total: 0, // 总页数
          currentPage: 1, // 当前页数
          pageSize: 10 // 每页显示多少条
        },
        reportResultOption: {
          page: true,
          menuWidth: 100,
          addBtn: false,
          editBtn: false,
          addRowBtn: false,
          indexLabel: "序号",
          index: true,
          indexWidth:70,
          cellBtn: false,
          delBtn: false,
          columnBtn: false,
          refreshBtn: false,
          filterBtn: false,
          searchBtn: false,
          keyId: "id",
          column: [

            {
              label: "报告类型",
              prop: "reportType",
              cell: true,
              formatter: function (row, value, label, column) {
                if (row.reportType == '1') {
                  return row.year + '年度监测分析报告'
                } else if (row.reportType == '2') {
                  return '中期评估报告'
                } else if (row.reportType == '3') {
                  return '期末总结报告'
                }
              },
            },
            {
              label: "创建部门",
              prop: "createUnit",
              cell: true
            },
            {
              label: "创建时间",
              prop: "createTime",
              cell: true,
              formatter: function (row, value, label, column) {
                return value.split(' ')[0]
              }
            },
          ]
        },
        adjustTableLoading: false,
        adjustResultListData: [],
        adjustResultPage: {
          total: 0, // 总页数
          currentPage: 1, // 当前页数
          pageSize: 10 // 每页显示多少条
        },
        adjustResultOption: {
          page: true,
          menuWidth: 100,
          addBtn: false,
          editBtn: false,
          addRowBtn: false,
          indexLabel: "序号",
          index: true,
          indexWidth:70,
          cellBtn: false,
          delBtn: false,
          columnBtn: false,
          refreshBtn: false,
          filterBtn: false,
          searchBtn: false,
          keyId: "id",
          column: [

            {
              label: "调整建议名称",
              prop: "reviseName",
              cell: true
            },
            {
              label: "调整内容",
              prop: "content",
              overHidden: true,
              cell: true
            },
            {
              label: "创建时间",
              width: 120,
              prop: "createTime",
              cell: true,
              formatter: function (row, value, label, column) {
                return value.split(' ')[0]
              }
            },
          ]
        },
        addReportForm: {
          title: null,
          pmuc: null,
          fileIds: [],
          material_fileIds: [],
          modifyOpinion: null,
          havModifyOpinion: false,
          modifyOpinion_fileIds: [],
          reportType: null,
          year: null,
          reportFilesId: null,
          createUnit: null,
          createUnitId: null,
          draftTime: null,

        },
        addReportFormReset: {
          title: null,
          pmuc: null,
          fileIds: [],
          material_fileIds: [],
          modifyOpinion: null,
          havModifyOpinion: false,
          modifyOpinion_fileIds: [],
          reportType: null,
          year: null,
          reportFilesId: null,
          createUnit: null,
          createUnitId: null,
          draftTime: null,
        },
        addReportResultTitle: '添加相关报告',
        addReportResultVisible: false,
        addReportFormRules: addReportFormRules,
        reportNameList: [
          {name: "年度监测分析报告", type: "1", disable: false},
          {name: "中期评估报告", type: "2", disable: false},
          {name: "期末总结报告", type: "3", disable: false}
        ],
        addOrEdit: true,
        isDisabled: false,
        projectForm: {
          textId: null,
        },
        pmucTemp: null,
        titleTemp: null,
        reportIdTemp: null,
        addReportResultKey: 10000,
        addAdjustResultTitle: '添加修订调整建议',
        addAdjustResultVisible: false,
        addAdjustResultKey: 1,
        addAdjustForm: {
          achievementId: null,
          reviseName: null,
          contentFileIds:[],
          content:null,
        },
        addAdjustFormReset: {
          achievementId: null,
          reviseName: null,
          contentFileIds:[],
          content:null,
        },
        addAdjustFormRules: addAdjustFormRules,
        addOrEditAdjust: true,
        reviseIdTemp:null,
        deptVisible: false,//起草单位树弹窗标志


      }
    },
    watch: {
      'addReportForm.reportType'(val) {
        if (val == '2' || val == '3') {
          this.addReportForm.year = null;
        }
      }
    },
    methods: {
      setAchievement() {
        resultDetail(this.$route.params.id).then(async response => {
          this.addReportForm.title = response.data.data.title;
          this.addReportForm.pmuc = response.data.data.pmuc;
          let pmuc = await response.data.data.pmuc;
          this.titleTemp = await response.data.data.title;
          this.pmucTemp = await response.data.data.pmuc;
          this.putReportResultList(pmuc);
        })
      },
      getReportResultList() {

      },
      putReportResultList(pmuc) {
        getReportResultList(Object.assign({
          current: 1,
          size: 10,
          pumc: pmuc,
        })).then(response => {
          let records = response.data.data.records;
          this.reportResultListData = records;
          this.reportResultPage.total = response.data.data.total;

          if (records != null && records.length != 0) {
            let hasMid = false;
            let hasEnd = false;
            for (let item in records) {
              if (records[item].reportType == '2') {  //已经有中期评估报告了
                this.reportNameList[1].disable = true;
                hasMid = true;
              } else if (records[item].reportType == '3') {  //已经有期末评估报告了
                this.reportNameList[2].disable = true;
                hasEnd = true;
              }
            }
            if (hasMid == false) {
              this.reportNameList[1].disable = false;
            }
            if (hasEnd == false) {
              this.reportNameList[2].disable = false;
            }
          }
        })
      },
      getReportResultListPage(page) {
        getReportResultList(Object.assign({
          current: page.currentPage,
          size: page.pageSize,
          pumc: this.pmucTemp,//后台将pumc拼写错了
        })).then(response => {
          let records = response.data.data.records;
          this.reportResultListData = records;
          this.reportResultPage.total = response.data.data.total;

          if (records != null && records.length != 0) {
            let hasMid = false;
            let hasEnd = false;
            for (let item in records) {
              if (records[item].reportType == '2') {  //已经有中期评估报告了
                this.reportNameList[1].disable = true;
                hasMid = true;
              } else if (records[item].reportType == '3') {  //已经有期末评估报告了
                this.reportNameList[2].disable = true;
                hasEnd = true;
              }
            }
            if (hasMid == false) {
              this.reportNameList[1].disable = false;
            }
            if (hasEnd == false) {
              this.reportNameList[2].disable = false;
            }
          }

        })
      },
      currentChange(currentPage) {
        var page = this.reportResultPage;
        page.currentPage = currentPage;
        this.getReportResultListPage(page);
      },
      sizeChange(pageSize) {
        var page = this.reportResultPage;
        page.pageSize = pageSize;
        this.getReportResultListPage(page);
      },
      addReportResult() {
        this.addReportResultKey = this.addReportResultKey + 1;
        this.addReportResultVisible = true;
        this.addReportResultTitle = '添加相关报告';
        this.addOrEdit = true;

      },
      editReportResult(row) {
        this.addReportResultKey = this.addReportResultKey + 1;
        this.addReportResultVisible = true;
        this.addReportResultTitle = '修改相关报告';
        this.addOrEdit = false;
        this.reportIdTemp = row.reportId;
        getReportDetail(row.reportId).then(response => {
          this.addReportForm.havModifyOpinion = response.data.data.havModifyOpinion;
          this.addReportForm.modifyOpinion = response.data.data.modifyOpinion;
          this.addReportForm.modifyOpinion_fileIds = response.data.data.modifyOpinion_fileIds;

          this.addReportForm.reportType = response.data.data.reportType;
          this.addReportForm.year = response.data.data.year;
          this.addReportForm.title = this.titleTemp;
          this.addReportForm.pmuc = this.pmucTemp;
          this.addReportForm.draftTime =response.data.data.draftTime;
          this.addReportForm.createUnitId =response.data.data.createUnitId;
          this.addReportForm.createUnit =response.data.data.createUnit;

          let fileIds = response.data.data.fileIds;
          if (fileIds != null && fileIds.length != 0) {
            this.addReportForm.fileIds = fileIds;
            this.projectForm.textId = fileIds[0];
            this.setFilesList(fileIds, 'fileIds');
          }

          let material_fileIds = response.data.data.material_fileIds;
          if (material_fileIds != null && material_fileIds.length != 0) {
            this.addReportForm.material_fileIds = material_fileIds;
            this.setFilesList(material_fileIds, 'material_fileIds');
          }


        })
      },
      commitReportResult() {
        var arr = [];
        if (this.fileListMixin.length != 0) {
          for (var item in this.fileListMixin) {
            arr.push(this.fileListMixin[item].url);
          }
          this.addReportForm.material_fileIds = arr;
        }
        this.addReportForm.reportFilesId = this.projectForm.textId;
        this.addReportForm.fileIds = [].concat();
        this.addReportForm.fileIds.push(this.addReportForm.reportFilesId);

        this.addReportForm.title = this.titleTemp;
        this.addReportForm.pmuc = this.pmucTemp;

        this.$refs.addReportForm.validate(valid => {
          if (valid) {
            this.$confirm("确定添加此报告吗?", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(() => {
              addReportResult(this.addReportForm).then(response => {
                if (response.data.code == 0) {
                  this.$notify({
                    title: "成功",
                    message: "添加成功",
                    type: "success",
                    duration: 2000
                  });
                  this.getReportResultListPage(this.reportResultPage);
                  this.addReportResultVisible = false;
                }
              })
            })
          }
        })
      },
      commitReportResultEdit() {
        var arr = [];
        if (this.fileListMixin.length != 0) {
          for (var item in this.fileListMixin) {
            arr.push(this.fileListMixin[item].url);
          }
          this.addReportForm.material_fileIds = arr;
        }
        this.addReportForm.reportFilesId = this.projectForm.textId;
        this.addReportForm.fileIds = [].concat();
        this.addReportForm.fileIds.push(this.addReportForm.reportFilesId);

        this.$refs.addReportForm.validate(valid => {
          if (valid) {
            this.$confirm("确定修改此报告吗?", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(() => {
              reportResultEdit(this.reportIdTemp, this.addReportForm).then(response => {
                if (response.data.code == 0) {
                  this.$notify({
                    title: "成功",
                    message: "修改成功",
                    type: "success",
                    duration: 2000
                  });
                  this.getReportResultListPage(this.reportResultPage);
                  this.addReportResultVisible = false;
                }
              })
            })
          }
        })
      },
      cancel() {
        this.addReportResultVisible = false;
      },
      close() {
        this.addReportForm =this.deepClone(this.addReportFormReset);
        this.projectForm.textId = null;
        this.fileListtextMixin = [].concat();
        this.fileListMixin = [].concat();

      },
      closed() {
        this.addReportForm = this.deepClone(this.addReportFormReset);
        this.projectForm.textId = null;
        this.fileListtextMixin = [].concat();
        this.fileListMixin = [].concat();
      },
      async setFilesList(fileIds, type) {
        let result = await getFileTypeFiles(fileIds);
        if (result != null && result.length != 0) {
          if (type == 'fileIds') {
            for (let item in result) {
              this.fileListtextMixin.push({name: result[item].fileName, url: result[item].fileId})
            }
          } else if (type == 'material_fileIds') {
            for (let item in result) {
              this.fileListMixin.push({name: result[item].fileName, url: result[item].fileId})
            }
          } else if (type == 'contentFileIds') {
            for (let item in result) {
              this.fileListMixinResult.push({name: result[item].fileName, url: result[item].fileId});
            }
          }
        }
      },

      //调整建议成果
      getAdjustResultList() {

      },
      putAdjustResultList() {
        getAdjustResultList(Object.assign({
          achievementId: this.$route.params.id,
          current: 1,
          size: 10,
        })).then(response => {
          this.adjustResultListData = response.data.data.records;
          this.adjustResultPage.total = response.data.data.total;
        })
      },
      getAdjustResultListPage(page) {
        getAdjustResultList(Object.assign({
          achievementId: this.$route.params.id,
          current: page.currentPage,
          size: page.pageSize,
        })).then(response => {
          this.adjustResultListData = response.data.data.records;
          this.adjustResultPage.total = response.data.data.total;
        })
      },
      adjustCurrentChange(currentPage) {
        var page = this.adjustResultPage;
        page.currentPage = currentPage;
        this.getAdjustResultListPage(page);
      },
      adjustSizeChange(pageSize) {
        var page = this.adjustResultPage;
        page.pageSize = pageSize;
        this.getAdjustResultListPage(page);
      },
      addAdjustResult() {
        this.addAdjustResultKey = this.addAdjustResultKey + 1;
        this.addAdjustResultVisible = true;
        this.addAdjustResultTitle = '添加修订调整建议';
        this.addOrEditAdjust = true;
      },
      editAdjustResult(row) {
        this.addAdjustResultKey = this.addAdjustResultKey + 1;
        this.addAdjustResultVisible = true;
        this.addAdjustResultTitle = '修改修订调整建议';
        this.addOrEditAdjust = false;
        this.reviseIdTemp = row.reviseId;
        getReviseDetail(row.reviseId).then(response => {
          let records = response.data.data;
          this.addAdjustForm.reviseName = records.reviseName;
          this.addAdjustForm.content = records.content;
          this.addAdjustForm.contentFileIds = records.contentFileIds;
          if (records.contentFileIds != null && records.contentFileIds.length != 0) {
            this.setFilesList(records.contentFileIds, 'contentFileIds')
          }

        })

      },
      adjustResultclose() {
        this.addAdjustForm = this.deepClone(this.addAdjustFormReset);
        this.fileListMixinResult = [].concat();
      },
      adjustResultclosed() {
        this.addAdjustForm = this.deepClone(this.addAdjustFormReset);
        this.fileListMixinResult = [].concat();
      },
      commitAdjustResult() {
        this.addAdjustForm.achievementId = this.$route.params.id;
        var arr = [];
        if (this.fileListMixinResult.length != 0) {
          for (var item in this.fileListMixinResult) {
            arr.push(this.fileListMixinResult[item].url);
          }
          this.addAdjustForm.contentFileIds = arr;
        }

        this.$refs.addAdjustForm.validate(valid => {
          if (valid) {
            this.$confirm("确定添加调整建议吗?", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(() => {
              addAdjustResult(this.addAdjustForm).then(response => {
                if (response.data.code == 0) {
                  this.$notify({
                    title: "成功",
                    message: "添加成功",
                    type: "success",
                    duration: 2000
                  });
                  this.getAdjustResultListPage(this.adjustResultPage);
                  this.addAdjustResultVisible = false;
                }
              })
            })
          }
        })

      },
      commitAdjustResultEdit() {
        this.addAdjustForm.achievementId = this.$route.params.id;
        var arr = [];
        if (this.fileListMixinResult.length != 0) {
          for (var item in this.fileListMixinResult) {
            arr.push(this.fileListMixinResult[item].url);
          }
          this.addAdjustForm.contentFileIds = arr;
        }
        this.$refs.addAdjustForm.validate(valid => {
          if (valid) {
            this.$confirm("确定修改调整建议吗?", "提示", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(() => {
              editReportOpinion(this.reviseIdTemp,this.addAdjustForm).then(response => {
                if (response.data.code == 0) {
                  this.$notify({
                    title: "成功",
                    message: "修改成功",
                    type: "success",
                    duration: 2000
                  });
                  this.getAdjustResultListPage(this.adjustResultPage);
                  this.addAdjustResultVisible = false;
                }
              })
            })
          }
        })
      },
      cancelAdjust() {
        this.addAdjustResultVisible = false;
      },
      // 返回首页
      goBack () {
        this.$router.push({ path: "/wel" });
      },
      //返回上一页
      beforeStep(){
        this.$router.go(-1)
      },
      // 弹出选择牵头部门弹框
      clickMainDept() {
        this.deptVisible = true
      },
      cancelDept(deptIds, deptNames) {
        this.deptVisible = false;
      },
      getSelectInfo(deptId, deptName) {
        this.addReportForm.createUnit = deptName;
        this.addReportForm.createUnitId = deptId;
        this.deptVisible = false;
      },

    },

  }
</script>

<style lang="scss" scoped>
  .card-border {
    border: 1px solid #d2d2d2;
    padding: 12px;
  }
</style>
